<?php
require_once 'Admin/Controller/Controller.php ';
require_once 'Admin/Model/UserModel.php';
class UserController extends Controller{
	function __Construct(){
		parent::__Construct();	
		if(!isset($this->model)){
			$this->model = new UserModel;
		}	
		$this->mod = 'user';
	}
	function index($mod=""){
		parent::index($this->mod);
		/*
		$data = $this->model->getList();
		$this->assign('list',$data);
		$this->view->display(); */


	}
	function form($mod=""){
		//$this->display();
		parent::form($this->mod);
	}
	function add($mod=""){
		parent::add($this->mod);
		/*$this->model = new UserModel();
		$data = $_POST;
		$result = $this->model->add($data);
		if($result){
			echo '添加成功 <a href="admin.php?c=user&m=index">如果没有跳转，请点这里跳转</a>';
   			header("refresh:3;url='admin.php?c=user&m=index'");
		}
		else{
			echo "添加失败！<br/>";
  			echo "<a href='admin.php?c=user&m=userform'>返回</a>";
		}
*/
	}
	function del($mod=""){	
		parent::del($this->mod);	
		/*$id = $_GET['id'];
		$result = $this->model->del($id);
		if($result){
			echo '删除成功 <a href="admin.php?c=user&m=index">如果没有跳转，请点这里跳转</a>';
   			header("refresh:3;url='admin.php?c=user&m=index'");
		}
		else{
			echo "删除失败！<br/>";
  			echo "<a href='admin.php?c=user&m=index'>返回</a>";
		}*/		
	}
	function dels(){}
	function mod($mod=""){
		parent::mod($this->mod);
		/*$id = $_GET['id'];
		$result = $this->model->getOneByID($id);
		$this->assign('one',$result);
		$this->display(); */
	}
	function update($mod=""){
		parent::update($this->mod);
		/*$data = $_POST;
		$result = $this->model->update($data);
		if($result){
			echo '更新成功 <a href="admin.php?c=user&m=index">如果没有跳转，请点这里跳转</a>';
   			header("refresh:3;url='admin.php?c=user&m=index'");
		}
		else{
			echo "更新失败！<br/>";
  			echo "<a href='admin.php?c=user&m=usermod&id=".$data['id']."'>返回</a>";
		}*/
	}
	function search(){

	}

}
?>